﻿@using Orchard.Utility.Extensions

@{
    string name = Model.Name;
    string mapLink =
        "http://www.bing.com/maps/?v=2&cp=" + @Model.PlaceLatLong +
        "&lvl=12@dir=0&sty=r&where1=" + @Model.PlaceLatLong.ToString().Replace("~", ",");
    string iframeSource =
        "http://www.bing.com/maps/embed/?v=2&cp=" + @Model.PlaceLatLong +
        "&lvl=15&amp;@dir=0&sty=r&where1=" + @Model.PlaceLatLong.ToString().Replace("~", ",") +
        "&form=LMLTEW&pp=" + @Model.PlaceLatLong +
        "&emid=30e5aeb2-f963-4089-e9b3-9bd5dfe07759"; 
}
<p class="text-field">
    @name.CamelFriendly():
    @if (!Model.ShowLink && ! Model.ShowMap) {
        <text>@Model.PlaceName</text>
    }
    @if (Model.ShowLInk) {
        <a href="@mapLink" target="_blank">@Model.PlaceName</a>
    }
    @if (Model.ShowMap) {
        <text>@Model.PlaceName</text>
        <div id="mapviewer">
            <iframe id="map" scrolling="no" width="400" height="300" frameborder="0" src="@iframeSource" />
        </div>
    }
</p>